<template>
  <div>{{ dateStr }}</div>
</template>

<script setup>
import dayjs from "dayjs";
const props = defineProps({
  value: "",
  format: {
    type: String,
    default: "YYYY-MM-DD",
  },
});
const dateStr = computed(() => {
  if (!props.value) {
    return "";
  } else {
    return dayjs(props.value).format(props.format);
  }
});
</script>

<style scoped lang="scss"></style>
